<script type="text/javascript">
	$(document).ready(function() {	});
	function laporan(pageURL, title,w,h){
		var periode_awal=document.getElementById('tanggal_awal').value;
		var periode_akhir=document.getElementById('tanggal_akhir').value;
		var akun = document.getElementById('akun')[document.getElementById('akun').selectedIndex].value;

		if ((periode_awal=='')||(periode_akhir=='')){
			alert('Isilah periode awal dan akhir');
		}else{
			var left = (screen.width/2)-(w/2);
			var top = (screen.height/2)-(h/2);
			var targetWin = window.open ('<?=site_url();?>/buku_besar/view_buku_kas_periode/'+periode_awal+'/'+periode_akhir+'/'+akun, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
			
			document.getElementById('tanggal_awal').value='';
			document.getElementById('tanggal_akhir').value='';			
		}	}
	
	$(function(){
		$("#tanggal_awal").datepicker({dateFormat: 'yy-mm-dd' });
	})	
	
	$(function(){
		$("#tanggal_akhir").datepicker({dateFormat: 'yy-mm-dd' });
	})	
	
		
	function klick_tanggal_awal(){
		var tanggal = document.getElementById("tanggal_awal");
		tanggal.focus();
	}
	
	function klick_tanggal_akhir(){
		var tanggal = document.getElementById("tanggal_akhir");
		tanggal.focus();
	}
	
	function batal(){
		document.location.href="<?=site_url();?>/dashboard";
	}
	
</script>

<div id="page-heading"><h1>Buku Besar</h1></div>

<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
		<?php

			$attributes = array('name' => 'form1', 'id' => 'form1', 'class'=>'block-content form');

			echo form_open('buku_besar/view_buku_kas_periode', $attributes);

		?>
<tr>
	<th rowspan="3" class="sized"><img src="<?php echo base_url() ?>asset/admin/images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
	<th class="topleft"></th>
	<td id="tbl-border-top">&nbsp;</td>
	<th class="topright"></th>
	<th rowspan="3" class="sized"><img src="<?php echo base_url() ?>asset/admin/images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
	
</tr>
<tr>
	<td id="tbl-border-left"></td>
	<td>
		<!--  start content-table-inner -->
		
		<div id="content-table-inner"> 
		<table border="0" width="100%" cellpadding="0" cellspacing="0">
		<tr valign="top">
			<td>

			<!--  start step-holder -->
			<div id="step-holder">
						<div class="step-no">1</div>
						<div class="step-light-left"><a href="#">Buku Besar</a></div>
						<div class="step-light-round">&nbsp;</div>
											
						<div class="clear"></div>
					</div>
			<!--  end step-holder -->
			<!-- start id-form -->
						<table border="0" cellpadding="0" cellspacing="0"  id="id-form">
						<tr>
							<th valign="top">Akun :</th>
							<td>
									<select name="akun" id="akun">
									<?php
										echo '<option value="all">All</option>';
										$query = $this->db->query('select * from master_akun order by akunid asc');
										if($query->num_rows() > 0)
										{
											foreach($query->result() as $row)
											{
												echo '<option value="'.$row->akunid.'">'.$row->akunid.'-'. $row->nakun . '</option>';
											}
										}
									?>
								</select>
							</td>
							<td></td>
						</tr>
						<tr>
							<th valign="top">Periode (*) :</th>
							<td><span class="relative">
										<span class="input-type-text margin-right relative"><input type="text" name="periode_awal" id="tanggal_awal" class="inp-form">  
										<img onclick="javascript:klick_tanggal_awal()" src="<?=base_url()?>asset/admin/images/icons/fugue/calendar-month.png" width="16" height="16"></span>
								</span></td>
							<td>&nbsp; &nbsp; &nbsp; &nbsp; s/d &nbsp; &nbsp; &nbsp;</td>
							<td>
								<span class="relative">
										<span class="input-type-text margin-right relative"><input type="text" name="periode_akhir" id="tanggal_akhir" class="inp-form">  
										<img onclick="javascript:klick_tanggal_akhir()" src="<?=base_url()?>asset/admin/images/icons/fugue/calendar-month.png" width="16" height="16"></span>
								</span>
							</td>
						</tr>
			<tr> 
				<td class="noheight" colspan="2">
				 &nbsp;
				</td>	
			</tr>
			<tr>			 
				<td class="noheight" colspan="2">			 
					<!--<button type="submit"><img src="<?=base_url()?>asset/admin/images/icons/fugue/tick-circle.png" width="16" height="16"> Upload</button>
					<button type="button" onclick="javascript:batal();" class="red">Batal</button> 	
					-->
					
					<button type="button" class="form-submit" onclick="laporan('<?=site_url();?>/buku_besar/view_buku_kas_periode/','name',1000,800)">Preview</button> 
					<button type="button" class="form-reset" onclick="javascript:batal()">Batal</button> 

				</td>	
			</tr>
			<tr>
				<th valign="top"></th>
				<td>	
					<br/><br/><br/><br/><br/><br/><br/><br/>
				</td> 
			</tr>
			
			</form>
			</table>
			<!-- end id-form  -->
			
		</td>
		</tr> 			
	 
					
		</table>	
		</div> 
		
			
	</td>
		 
		 
	<div class="clear"></div>
 

	 
	<td id="tbl-border-right"></td>
</tr>
<tr>
	<th class="sized bottomleft"></th>
	<td id="tbl-border-bottom">&nbsp;</td>
	<th class="sized bottomright"></th>
</tr>
</form>
</table>




